#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main() {
	double x;
	cin >> x;

	double ans = 0;
	int f = 1;
	for (int i = 1; i <= 1000; i++) {
		double t = 1.0 / i / (i + 1);
		if (t < x)
			break;
		ans += f * t;
		f *= -1;
	}
	cout << fixed << setprecision(4) << ans;
	return 0;
}
